package services

import (
	"gitee.com/cjf8134/bbs_serve/internal/app/apiserve/repositories"
	"gitee.com/cjf8134/bbs_serve/internal/pkg/minio"
	"github.com/gomodule/redigo/redis"
	"github.com/google/wire"
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

type DefaultService struct {
	logger     *zap.Logger
	v          *viper.Viper
	Repository repositories.MysqlApiServeRepository
	pool       *redis.Pool
	mioClient        *minio.ClientType
}

func NewService(
	logger *zap.Logger,
	v *viper.Viper,
	repository repositories.MysqlApiServeRepository,
	pool *redis.Pool,
	mioClient *minio.ClientType,
) DefaultService {
	return DefaultService{
		logger:     logger.With(zap.String("type", "DefaultService")),
		v:          v,
		Repository: repository,
		pool:       pool,
		mioClient:        mioClient,
	}
}

var ProviderSet = wire.NewSet(NewService)
